<?php
include("inc/class.otr.php");
$otr = new OTR();

if(!$otr->checkLogin()){
	header("Location: index.php");
}

$customers = $otr->getCustomers();
?>
<div id="customers" style="float: left;">
	Customers
<?php
	foreach($customers as $c){
?>
	<div class="menuitem" onclick="loadCustomer(<?php echo($c['id']);?>);">&gt; <?php echo($c['company']);?></div>
<?php
	}
?>
	<div class="menuitem" onclick="loadCustomer(0);">Add new...</div>
</div>
<div id="pnlCustomer"  style="float: left;">
</div>
<script type="text/javascript">
	var loadCustomer = function(id){
		ajaxGet('customer.php', 'id='+id, $('pnlCustomer'), null);
	}
</script>